As used herein, the term "multiprocessing" should be understood to include not only computer systems having distinct independent multiple processors but also so-called "multi-threading" systems in which independent process threads can exist concurrently. The term "process" includes any application program.
Wherever multiple processes have access to shared data, it is well known that access restrictions are necessary to prevent unwanted overwriting by one process or application of data items which another application may be in the process of using. The object is to achieve serialisation, that is that the result of processing for any application should be the same as if it had had sole access to the data items and had processed them serially. Such restrictions are commonly achieved by locking data items so that other applications cannot access them at all (exclusive locks) or so that other applications can only access them for a non-destructive purpose such as reading their contents (shared locks).
Very sophisticated locking arrangements are used in database products where many users have access to the shared data in the data base. One form of database is hierarchical, such as the IMS product from IBM ("IMS" and "IBM" are trademarks of International Business Machines Corporation). In such a database, it is known that not only can individual items be locked but that also that locking of a top layer item in the hierarchy can be used to lock all subordinate segments depending from the top layer item.
Often, database managers employ index trees of keys to individual data items to speed up searching for those items and these index trees can be used as the basis for locking. The trees consist of root, branch and leaf nodes (which are pointers to the actual data items). Not only can individual leaf nodes be locked but also their parent nodes (branch nodes or even root nodes). If a branch or root node is locked then all its child nodes are also locked.
U.S. Pat. No. 5,485,607 "Concurrency control method and apparatus in a database management system utilizing key-valued locking", describes a system in which keys, rather than actual data items, are used for locking and mentions a concept known as "range-locking" where not only are individual key values locked but also ranges of keys, including the individual keys of interest are also locked.
In data bases, the data may be changed relatively infrequently and is usually read non-destructively. However, the need for locking arises in other types of system as well, however. One type of system in which locking has been practised is a message queuing system, such as IBM's MQSeries family of products (the term "MQSeries" is a trademark of International Business Machines Corporation). In message queuing systems, communication between programs residing on different nodes of a network is by means of queues onto which the programs put messages or from which they get messages for use by other programs. Management of these queues is under control of a queue manager.
Because queues may, in general, be accessible to more than one application, MQSeries products need to be able to lock messages on queues in order to ensure their integrity. This is particularly so as the MQSeries "GET" operation is normally destructive of the message as the whole purpose is to allow applications to remove the message from the queue for processing after which its retention on the queue serves no purpose.
In a recent extension of MQSeries, it has been recognised that groups of messages may be logically related or that very large messages, which are too large for the system buffers may have to be segmented into a group of related segments. This concept is described in the "MQSeries Application Programming Guide" (SC33-0807-07, Eighth Edition, August 1997), available from IBM. However, a problem has arisen in that locking of an individual message in a group or of a segment in a segmented message will not necessarily prevent other applications removing the related messages or segments before a requesting application has had a chance to process them. As such messages are in an unstructured peer group and are not hierarchically arranged or within quantifiable ranges, the prior art locking techniques cannot provide an effective locking option for the group.